package com.test.schoolhelper.ui.activity;

import android.view.LayoutInflater;
import android.view.View;

import androidx.annotation.NonNull;

import com.test.schoolhelper.R;
import com.test.schoolhelper.base.BaseActivity;
import com.test.schoolhelper.databinding.ActivityNewsBinding;
import com.test.schoolhelper.entity.News;


// TODO: 2024/5/29 新闻详情
public class NewsActivity extends BaseActivity<ActivityNewsBinding> {

    @Override
    protected void initData() {
        News.Result.Data data = (News.Result.Data) getIntent().getSerializableExtra("data");
        if (data != null) {
            getBinding().webView.loadUrl(data.getUrl());
        }

    }

    @Override
    protected void initClick() {
        super.initClick();
        getBinding().ivBack.setOnClickListener(view -> {
            finish();
        });
    }

    @Override
    protected int initLayout() {
        return R.layout.activity_news;
    }

    @Override
    protected ActivityNewsBinding onCreateViewBinding(@NonNull LayoutInflater layoutInflater) {
        return ActivityNewsBinding.inflate(layoutInflater);
    }

}